#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;
int main()
{
	int n;
	cin >> n;
	if (n >= 0 && n <= 9)
	{
		int  mark = 1;
		for (int i = 1; i <= n; i++)
		{
			for (int j = 1; j <= n; j++)
			{
				if (mark < 10)
					cout << 0 << mark;
				if (mark >= 10)
					cout << mark;
				mark++;
			}
			cout << endl;
		}
		cout << endl;
		mark = 1;
		for (int i = 1; i <= n; i++)
		{
			for (int j = 1; j <= n - i; j++)
				cout << "  ";
			for (int j = 1; j <= i; j++)
			{
				if (mark < 10)
					cout << 0 << mark;
				else if (mark >= 10)
					cout << mark;
				mark++;
			}
			cout << endl;
		}

	}
	return 0;
}